home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #9
/
Amiga Plus CD - 2004 - No. 09.iso
/
amigaplus
/
tools
/
dev_libs
/
feelin040718
/
sources
/
shade
/
renderbuffer.c
< prev
next >
Wrap
C/C++ Source or Header
|
2004-08-03
|
1KB
|
69 lines
#include "Private.h"
///CreateRPBitMap
struct RastPort * CreateRPBitMap(UWORD Width,UWORD Height,struct Screen *Scr)
{
struct RastPort *rp;
struct BitMap *frn = (Scr) ? Scr -> RastPort.BitMap : NULL;
if (rp = F_New(sizeof (struct RastPort)))
{
InitRastPort(rp);
if (rp -> BitMap = AllocBitMap(Width,Height,GetBitMapAttr(frn,BMA_DEPTH),BMF_INTERLEAVED,frn))
{
return rp;
}
F_Dispose(rp);
}
return NULL;
}
//+
///DeleteRPBitMap
void DeleteRPBitMap(struct RastPort *rpb)
{
if (rpb)
{
if (rpb -> BitMap) FreeBitMap(rpb -> BitMap);
F_Dispose(rpb);
}
}
//+
///CreateRenderBuffer
struct FeelinRender * CreateRenderBuffer(UWORD Width,UWORD Height,struct FeelinRender *Friend)
{
struct Screen *scr;
if (scr = (APTR) F_Get(Friend -> Display,(ULONG) "FA_Display_Screen"))
{
struct RastPort *rp;
if (rp = CreateRPBitMap(Width,Height,scr))
{
struct FeelinRender *render;
if (render = F_NewObj(FC_Render,
FA_Render_Friend, Friend,
FA_Render_RPort, rp,
TAG_DONE))
{
return render;
}
}
DeleteRPBitMap(rp);
}
return NULL;
}
//+
///DeleteRenderBuffer
void DeleteRenderBuffer(struct FeelinRender *Render)
{
if (Render)
{
DeleteRPBitMap(Render -> RPort);
F_DisposeObj(Render);
}
}
//+